# -*- coding: utf-8 -*-
# $Id: undo.py 11 2008-02-09 18:44:25Z gkuznets $

# mpcheckup
# Copyright 2008 Grigoriy Kuznetsov (gkuznets@yandex.ru)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from PyQt4 import QtGui
from PyQt4.QtGui import QUndoCommand
from core.batch import *

class SBTG_UC(QtGui.QUndoCommand):
  def __init__(self, bno, gno):
    QtGui.QUndoCommand.__init__(self)
    self.bno_ = bno
    self.gno_ = gno
    
  def undo(self):
    batch = Batches.find(self.bno_)
    batch.take_back(complete=False)
    
class BB_UC(QtGui.QUndoCommand):
  def __init__(self, bno, gno):
    QtGui.QUndoCommand.__init__(self)
    self.bno_ = bno
    self.gno_ = gno
    
  def undo(self):
    batch = Batches.find(self.bno_)
    batch.take_back()
